package com.miaosha.service;

import com.miaosha.error.BusinessException;
import com.miaosha.service.model.ItemModel;

import java.util.List;

public interface ItemService {
    //创建商品
    ItemModel creatItem(ItemModel itemModel) throws BusinessException;
    //商品列表
    List<ItemModel> listItem();
    //商品详情
    ItemModel getItemById(Integer id);

    //下单过程中，库存扣减锁死
    boolean decreaseStock(Integer itemId, Integer amount)throws BusinessException;

    //下单成功，商品销量增加
    void increaseSales(Integer itemId, Integer amount)throws BusinessException;
}
